using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class ItemPricesinallGuarantorMap : EntityTypeConfiguration<ItemPricesinallGuarantor>
    {
        public ItemPricesinallGuarantorMap()
        {
            // Primary Key
            this.HasKey(t => new { t.transid, t.Type, t.Number });

            // Properties
            this.Property(t => t.transid)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Type)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Number)
                .IsRequired()
                .HasMaxLength(8);

            // Table & Column Mappings
            this.ToTable("ItemPricesinallGuarantor");
            this.Property(t => t.transid).HasColumnName("transid");
            this.Property(t => t.Type).HasColumnName("Type");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.Total_price).HasColumnName("Total_price");
            this.Property(t => t.Guarantor1_Total_Price).HasColumnName("Guarantor1_Total_Price");
            this.Property(t => t.Guarantor2_Total_Price).HasColumnName("Guarantor2_Total_Price");
        }
    }
}
